package com.yeqifu.bus.service.impl;

import com.yeqifu.bus.domain.Customer;
import com.yeqifu.bus.mapper.CustomerMapper;
import com.yeqifu.bus.service.ICustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceImpl implements ICustomerService {

    @Autowired
    private CustomerMapper customerMapper;


    @Override
    public List<Customer> getCustomerList(Customer customer) {
        return customerMapper.getCustomerList(customer);
    }

    @Override
    public int addCustomer(Customer customer) {
        return customerMapper.addCustomer(customer);
    }

    @Override
    public int updateCustomer(Customer customer) {
        return customerMapper.updateCustomer(customer);
    }

    @Override
    public String deleteCustomer(Customer customer) {

        int i = customerMapper.deleteCustomer(customer);
        return String.valueOf(i);
    }

    @Override
    public void deleteBatchCustomer(String[] identity) {
        for (String id : identity) {
             customerMapper.deleteBatchCustomer(id);
        }

    }
}
